

package com.zdsx;

import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;


/**
 * renren-admin
 *
 * @author Lr
 */
@SpringBootApplication
public class AdminApplication extends SpringBootServletInitializer {

	public static void main(String[] args) {
//		RedisTemplate t = null;
		StringRedisTemplate redisTemplate = new StringRedisTemplate();
//		redisTemplate.opsForValue()
		SpringApplication.run(AdminApplication.class, args);
		Redisson client = (Redisson) Redisson.create();
		RLock lock = client.getLock("lock-key");
		RLock rLock = client.getRedLock(lock);
		lock.lock();
		lock.unlock();
//		FileChannel
//		String.class.getClassLoader()
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(AdminApplication.class);
	}
}